#ifndef ADVANCEDSHOWDESKTOP_H
#define ADVANCEDSHOWDESKTOP_H

class AdvancedShowDesktop;

#include "common.h"
#include "WMCallback.h"
#include "WindowVisibilityHelper.h"
#include "CassiopeiaMain.h"

class AdvancedShowDesktop :	public CassiopeiaComponent
{
public:
	~AdvancedShowDesktop();

	CCState Activate();
	CCState Deactivate();
	void ToggleDesktop(bool forceRestore = false);

	static AdvancedShowDesktop* CreateInstance(HINSTANCE hInstance);
private:
	AdvancedShowDesktop(HINSTANCE hInstance);

	void ShowDesktop();
	void RestoreWindows();

	HMONITOR currentMonitor;
	bool windowsHidden;
	set<HWND> hiddenHWnds;
	HINSTANCE hInstance;
	WindowVisibilityHelper* windowVisibilityHelper;

	static AdvancedShowDesktop* instance;
	static HWINEVENTHOOK hWinEventHook;
	static HHOOK hKeyboardHook;
	static bool shortcutDown;

	static VOID CALLBACK WinEventProc(HWINEVENTHOOK hWinEventHook,DWORD dwEvent,HWND hWnd,LONG idObject,LONG idChild,DWORD idEventThread,DWORD dwmsEventTime);
	static LRESULT CALLBACK KeyboardHookProc (int code,WPARAM wParam,LPARAM lParam);
	static BOOL CALLBACK EnumWindowsProc(HWND hWnd,LPARAM lParam);	
};

#endif

